﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace Tools
{
    public class NetTool
    {
        public static bool Ping(string ip, int timeOut)
        {
            try
            {
                Ping ping = new Ping();
                PingReply pr = ping.Send(ip, timeOut);
                if (pr.Status == IPStatus.Success)
                    return true;
                else
                    return false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
